Typically, you won’t need to create your own geometries from scratch because you’ll just be reading them in from geospatial data files.
But sf does provide functions for doing so.
Here are the geometries from our previous slide:
pnt = st_point(c(2, 4))
mpnt = st_multipoint(rbind(c(2, 2), c(3, 3), c(3, 2)))
line = st_linestring(rbind(c(0, 3), c(1, 4), c(2, 3)))
poly = st_polygon(list(rbind(c(1, 0), c(3, 4), c(5, 1), c(1, 0))))
plot(poly, col = 'yellow')
plot(line, col = 'blue', lwd = 3, add = T)
plot(mpnt, col = 'red', add = T)
plot(pnt, col = 'black', add = T)

##sf objects: geometries
For comparison, we can take a look at one of the sfg objects in our census tracts:
geom = tracts$geometry[[1]]
str(geom)
## List of 1
## $ :List of 1
## ..$ : num [1:9, 1:2] -13637736 -13636969 -13636954 -13636940 -13636925 ...
## - attr(*, "class")= chr [1:3] "XY" "MULTIPOLYGON" "sfg"
geom[[1]]
## [[1]]
## [,1] [,2]
## [1,] -13637736 4546153
## [2,] -13636969 4546189
## [3,] -13636954 4545919
## [4,] -13636940 4545657
## [5,] -13636925 4545394
## [6,] -13637652 4545354
## [7,] -13637682 4545615
## [8,] -13637709 4545877
## [9,] -13637736 4546153
Again, note that the first and last coordinate-pairs are the same, because this is a polygon!